package com.isunland.managesystem.entity;

import com.isunland.managesystem.base.BaseEntity;
import com.isunland.managesystem.base.BaseModel;
import java.util.ArrayList;

public class LocalConfigOriginal extends BaseEntity<LocalConfigOriginal.LocalConfigModel> {
  //定义
  //会员编号
  private static final String MEMBER_DEFALT = "000000";
  private static final String MEMBER_XPD = "100014";//信普达
  private static final String MEMBER_DXYK = "100032";//东鑫永康
  private static final String MEMBER_BHKY = "100034";//渤海康源
  private static final String MEMBER_SJCL = "100022";//四季常绿
  //模块编码
  //客户组织关系
  private static final String MODEL_DEPT = "deptColumns";

  //产品实销
  private static final String MODEL_SALE = "subConColumns";
  //个人财务报销
  private static final String MODEL_FINANCE = "appFinance";
  private static final String MODEL_DEVELOP = "developExpenseEecord";
  //配置
  private static final int DEPT_000000 = 1;//客户组织关系
  private static final int DEPT_100032 = 2;
  private static final int SALE_000000 = 3;//产品实销
  private static final int SALE_100034 = 4;
  private static final int FINANCE_000000 = 5;//个人财务报销
  private static final int FINANCE_100022 = 6;
  private static final int FINANCE_100014 = 7;
  private static final int DEVELOP_000000 = 8;
  private static final int DEVELOP_100032 = 9;

  /*
       "module":"deptColumns",
        "field": "deptManager",
        "title": "部门主管自定义",
        "hidden": false
       */
  public ArrayList<LocalConfigOriginal> generate() {

    ArrayList<LocalConfigOriginal> list = new ArrayList<>();

    list.add(generateOrgnization(DEPT_000000));
    list.add(generateOrgnization(DEPT_100032));
    list.add(generateOrgnization(SALE_000000));
    list.add(generateOrgnization(SALE_100034));
    list.add(generateOrgnization(FINANCE_000000));
    list.add(generateOrgnization(FINANCE_100014));
    list.add(generateOrgnization(FINANCE_100022));
    list.add(generateOrgnization(DEVELOP_000000));
    list.add(generateOrgnization(DEVELOP_100032));

    return list;
  }

  private LocalConfigOriginal generateOrgnization(int type) {

    //1.一条数据
    LocalConfigOriginal original = new LocalConfigOriginal();
    //1.2列名,自定义标题,是否隐藏.
    ArrayList<LocalConfigModel> childList = new ArrayList<>();

    switch (type) {
      case DEPT_000000:

        original.setResult(MEMBER_DEFALT);
        original.setMessage(MODEL_DEPT);

        childList.add(new LocalConfigModel("deptName", 100, "部门名称", false));
        childList.add(new LocalConfigModel("deptDuty", 101, "部门职责说明", false));
        childList.add(new LocalConfigModel("deptManager", 102, "部门经理", false));
        childList.add(new LocalConfigModel("deptHolder", 103, "部门主管", false));
        childList.add(new LocalConfigModel("level", 104, "级别/编号", false));
        childList.add(new LocalConfigModel("name", 105, "员工姓名", false));

        break;
      case DEPT_100032:

        original.setResult(MEMBER_DXYK);
        original.setMessage(MODEL_DEPT);

        childList.add(new LocalConfigModel("deptName", 100, "科室", false));
        childList.add(new LocalConfigModel("deptDuty", 101, "科室职责说明", false));
        childList.add(new LocalConfigModel("deptManager", 102, "科室主任", false));
        childList.add(new LocalConfigModel("deptHolder", 103, "主管院长", false));
        childList.add(new LocalConfigModel("level", 104, "客户级别", false));
        childList.add(new LocalConfigModel("name", 105, "医生姓名", false));

        break;

      case SALE_000000:

        original.setResult(MEMBER_DEFALT);
        original.setMessage(MODEL_SALE);

        childList.add(new LocalConfigModel("fee", 106, "费用", true));
        childList.add(new LocalConfigModel("affectDate", 107, "实销日期", true));
        childList.add(new LocalConfigModel("market", 108, "终端市场", true));

        break;
      case SALE_100034:

        original.setResult(MEMBER_BHKY);
        original.setMessage(MODEL_SALE);

        childList.add(new LocalConfigModel("fee", 106, "费用", true));
        childList.add(new LocalConfigModel("affectDate", 107, "实销日期", true));
        childList.add(new LocalConfigModel("market", 108, "医院名称", false));

        break;

      case FINANCE_000000:

        original.setResult(MEMBER_DEFALT);
        original.setMessage(MODEL_FINANCE);

        childList.add(new LocalConfigModel("payeeBank", 109, "收款开户行", false));
        childList.add(new LocalConfigModel("payeeAccname", 110, "收款账户", false));
        childList.add(new LocalConfigModel("payeeAccount", 111, "收款账号", false));
        childList.add(new LocalConfigModel("billFee", 112, "票据费用", true));
        childList.add(new LocalConfigModel("billAmount", 113, "票据费用合计", true));
        childList.add(new LocalConfigModel("deductionAmount", 114, "冲抵预存票合计", true));
        childList.add(new LocalConfigModel("payerBank", 115, "借款人开户行", false));
        childList.add(new LocalConfigModel("payerAccount", 116, "借款账号", false));
        childList.add(new LocalConfigModel("payerAccname", 117, "借款账户", false));
        childList.add(new LocalConfigModel("payerAccname", 117, "借款账户", false));
        childList.add(new LocalConfigModel("contractName", 118, "项目/合同", true));

        break;

      case FINANCE_100022:

        original.setResult(MEMBER_SJCL);
        original.setMessage(MODEL_FINANCE);

        childList.add(new LocalConfigModel("payeeBank", 109, "收款开户行", true));
        childList.add(new LocalConfigModel("payeeAccname", 110, "收款账户", true));
        childList.add(new LocalConfigModel("payeeAccount", 111, "收款账号", true));
        childList.add(new LocalConfigModel("billFee", 112, "票据费用", true));
        childList.add(new LocalConfigModel("billAmount", 113, "票据费用合计", true));
        childList.add(new LocalConfigModel("deductionAmount", 114, "冲抵预存票合计", true));
        childList.add(new LocalConfigModel("payerBank", 115, "借款人开户行", true));
        childList.add(new LocalConfigModel("payerAccount", 116, "借款账号", true));
        childList.add(new LocalConfigModel("payerAccname", 117, "借款账户", true));
        childList.add(new LocalConfigModel("contractName", 118, "项目/合同", false));

        break;

      case FINANCE_100014:

        original.setResult(MEMBER_XPD);
        original.setMessage(MODEL_FINANCE);

        childList.add(new LocalConfigModel("payeeBank", 109, "收款开户行", false));
        childList.add(new LocalConfigModel("payeeAccname", 110, "收款账户", false));
        childList.add(new LocalConfigModel("payeeAccount", 111, "收款账号", false));
        childList.add(new LocalConfigModel("billFee", 112, "票据费用", false));
        childList.add(new LocalConfigModel("billAmount", 113, "票据费用合计", false));
        childList.add(new LocalConfigModel("deductionAmount", 114, "冲抵预存票合计", false));
        childList.add(new LocalConfigModel("payerBank", 115, "借款人开户行", false));
        childList.add(new LocalConfigModel("payerAccount", 116, "借款账号", false));
        childList.add(new LocalConfigModel("payerAccname", 117, "借款账户", false));
        childList.add(new LocalConfigModel("contractName", 118, "项目/合同", true));

        break;
      case DEVELOP_000000:

        original.setResult(MEMBER_DEFALT);
        original.setMessage(MODEL_DEVELOP);

        childList.add(new LocalConfigModel("market", 119, "终端市场", true));

        break;
      case DEVELOP_100032:

        original.setResult(MEMBER_BHKY);
        original.setMessage(MODEL_DEVELOP);

        childList.add(new LocalConfigModel("market", 119, "医院名称", false));

        break;
    }

    original.setRows(childList);
    return original;
  }

  public class LocalConfigModel extends BaseModel {

    private String field;//字段名
    private int fieldId;//ios用数字id.
    private String title;//标题
    private boolean hidden;//可见性
    private boolean ifedit;//是否可编辑

    public LocalConfigModel() {
    }

    public LocalConfigModel(String field, int fieldId, String title, boolean hidden) {
      this.field = field;
      this.fieldId = fieldId;
      this.title = title;

      this.hidden = hidden;
    }

    public String getField() {
      return field;
    }

    public void setField(String field) {
      this.field = field;
    }

    public String getTitle() {
      return title;
    }

    public void setTitle(String title) {
      this.title = title;
    }

    public boolean isHidden() {
      return hidden;
    }

    public void setHidden(boolean hidden) {
      this.hidden = hidden;
    }

    public int getFieldId() {
      return fieldId;
    }

    public void setFieldId(int fieldId) {
      this.fieldId = fieldId;
    }

    public boolean isIfedit() {
      return ifedit;
    }

    public void setIfedit(boolean ifedit) {
      this.ifedit = ifedit;
    }
  }
}
